#! /bin/csh -f

# Filename:      synth_spartan_3e.csh
# Description:   This script runs through the Synthesis flow
#
# Date Created:  7/20/2011
#

if(! -d ./work/) then
  echo "mkdir ./work/"
  mkdir work
endif

cd work

rm -rf *

mkdir xst
mkdir tmp

echo "XST"
xst -intstyle ise -ifn "../omicron.xst" -ofn "omicron.syr" | tee omicron_xst.log

echo "NGDBUILD"
ngdbuild -intstyle ise -dd _ngo -sd ../../des/data_mem -sd ../../des/instr_mem -nt timestamp -i -p xc3s500e-fg320-4 omicron.ngc omicron.ngd  

echo "MAP"
map -intstyle ise -p xc3s500e-fg320-4 -cm area -ir off -pr off -c 100 -o omicron_map.ncd omicron.ngd omicron.pcf 

echo "PAR"
par -w -intstyle ise -ol high -t 1 omicron_map.ncd omicron.ncd omicron.pcf 

echo "TRCE"
trce -intstyle ise -v 3 -s 4 -n 3 -fastpaths -xml omicron.twx omicron.ncd -o omicron.twr omicron.pcf

echo "BITGEN"
bitgen -intstyle ise -f ../omicron.ut omicron.ncd

echo "synth_spartan_3e.csh Done"
